import request from "@/utils/request";
//获取科室列表
export const getDepartMentListAPI = ({pageNo=1,pageSize=10})=>{
    return request.get(`/depart/getdepartList?pageNo=${pageNo}&pageSize=${pageSize}`)
}
//添加科室或者修改
export const addDepartMentAPI = (data)=>{
    if(data._id) {
        return request.put(`/depart/updateDepart?id=${data._id}`,data)
    }else {
        return request.post('/depart/addDepart',data)
    }
}
//添加二级科室
export const addTwoDepartMentAPI = (id,tweName)=>{
    return request({
        url:`/depart/addDepartTwo?id=${id}`,
        method:'post',
        data:{
            tweName
        }
    })
}
//删除科室
export const deleteDepartMentAPI = (id)=>request.delete(`/depart/deleteDapart?id=${id}`)